/**
 * 项目配置
 */
const isDev = !(location.host.indexOf('oschina') > -1)

export default {
  isDev: isDev,
  // 基本匹配
  baseConfig: {
    xsrfToken: 'unique-submit-token',
    baseURL: isDev ? '/main/action' : 'http://qatest1.mytijian.cn/main/action', // 接口根地址
    db_prefix: 'mt_mobile_', // 本地存储的key的前缀
  },

  // 主题配置
  color: {
    'brand-primary': '#32c5bd',
    'brand-success': '#32c5bd',
    'brand-warning': '#ff9913',
    'brand-error': '#ec3a43',
  },
  style: {
    'brand-primary': [
      {
        cls: '.weui-btn_primary:not(.weui-btn_disabled):active',
        props: {'background-color': 0.2},
      },
      {
        cls: '.weui-btn_disabled.weui-btn_primary',
        props: {'background-color': -0.2},
      },
      {
        cls: '.weui-cells_radio .weui-check:checked + .weui-icon-checked:before',
        props: {'color': 0},
      },
      {
        cls: '.weui-cells_checkbox .weui-check:checked + .weui-icon-checked:before, .weui-vcode-btn',
        props: {'color': 0},
      },
      {
        cls: '.weui-switch:checked, .weui-switch-cp__input:checked ~ .weui-switch-cp__box',
        props: {'color': 0},
      },
      {
        cls: '.mt-header,.weui-text-primary',
        props: {'border-bottom-color': 0},
      },
      {
        cls: '.weui-btn_primary,.weui-slider__track',
        props: {'background-color': 0},
      },
      {
        cls: '.weui-btn_plain-primary',
        props: {'color': 0, 'border-color': 0},
      },
      {
        cls: '.weui-icon-success, .weui-icon-download, .weui-icon-info-circle',
        props: {'color': 0},
      },
      {
        cls: '.weui-switch:checked, .weui-switch-cp__input:checked ~ .weui-switch-cp__box',
        props: {'border-color': 0, 'background-color': 0},
      },
      {
        cls: '.weui-btn_plain-primary:not(.weui-btn_plain-disabled):active',
        props: {'color': -0.2, 'border-color': -0.2},
      },
    ]
  },
}


/**
 * 主题配置管理
 * 1. JS不能直接操作伪类和伪元素，样式类切换
 * 2. 将项目中的伪类与伪元素的样式抽离出来单独管理
 */

 // @brand-primary: #32c5bd;
 // @brand-primary-tap: #2DB1AA;
 // @brand-success: #32c5bd;
 // @brand-warning: #ff9913;
 // @brand-error: #ec3a43;
 // @brand-hot: #f96268;        // 用于推荐/促销/折扣
 // @brand-important: #ff5b05;  // 用于小红点
